Page({
    data:{
        focus: false,
        inputValue:'',
        tempInfo:[],
        personList:[]
    },
    formSubmit: function(e) {
     
     let _data = this.handleData(e.detail.value,'sex')
    //  debugger;
      
        
     this.data.tempInfo.push({"userName":_data.userName,"sex":_data.sex})
    
      this.setData({
        personList : this.data.tempInfo,
        inputValue : ' '
      })
      //this.personList = e.detail.value;
      console.log('form发生了submit事件，携带数据为：', e.detail.value)
      console.log(this.data.personList);
      e.detail.value.userName = ''
    },
    formReset: function() {
      console.log('form发生了reset事件')
    },
    handleData: function(obj,handleType) {
      let _data = obj;
      if(handleType == 'sex'){
        if(_data.sex == '1'){
          _data.sex = '男'
        }else{
          _data.sex = '女'
        }
        
      }
      //////

      //////
      return _data;
    }
})